package com.prnasia.cloud.spring.amp_consul.web;

import com.prnasia.cloud.spring.entity.config.SendmailConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Wen Gao on 2019/4/11.
 */
@RestController
@RefreshScope
public class AmpConsulController {

    @Autowired
    private SendmailConfig sendmailConfig;

    @Value("${sendmail.url}")
    private String sendmailUrl;

    @GetMapping("/getSendmailConfig")
    public SendmailConfig getSendmailConfig() {
        System.out.println(sendmailUrl);
        return sendmailConfig;
    }


}
